public class Ques implements Runnable{

    private int count = 5;

    public void run(){

        for(int i = 0; i < 10; i++){
            if(count > 0){
                try{
                    Thread.sleep(1000);
                }catch(Exception e){
                    e.printStackTrace();
                }

                System.out.println(count--);
            }
        }

    }

    public static void main(String[] args){

        Ques q = new Ques();
        Thread t1 = new Thread(q);
        Thread t2 = new Thread(q);
        Thread t3 = new Thread(q);

        t1.start();
        t2.start();
        t3.start();
    }

}